package cn.kimming.shirodemo.controller;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
    @RequiresRoles(value = {"doctor"})
    @GetMapping("/hello")
    public String hello() {
        return "hello";
    }

    @RequiresAuthentication
    @GetMapping("/hi")
    public String hi() {
        return "hi";
    }

    @GetMapping("/bye")
    public String bye() {
        return "bye";
    }
}
